propsage.namespace("modules.admin.modules.accounting");

modules.admin.modules.accounting.chartOfAccounts = (function($){
	function initComponents()
	{
	
	}

	function initEventHandlers()
	{
		$('#btnDeleteSelected').click(function(e) {
			var count = $('#chart_of_accounts_grid .checkbox-column :checkbox:checked').not('#chart_of_accounts_grid_cid_all').length;
			
			var confirm = window.confirm('Deleted ' + count + ' accounts?');			
			if (!confirm) {
				return false;
			} 
		});
	}
	
	function onGridAfterDelete(link,success,response) {
		var data = $.parseJSON(response);
		if(data.success == false) {
			alert(data.errorMsg);
		}
	}
	
	$(document).ready(function(){
		initComponents();
		initEventHandlers();
	});
	
	return {
		onGridAfterDelete: onGridAfterDelete
	};
	
}(jQuery));